package edu.ou.herbarium.main;

import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.*;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.annotation.Resource;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.handler.MessageContext;
import org.apache.catalina.util.MD5Encoder;
import org.apache.commons.codec.binary.Hex;
import org.hibernate.Transaction;
import edu.ou.herbarium.data.HibernateSessionFactory;
import edu.ou.herbarium.service.Authority;
import edu.ou.herbarium.service.Collector;
import edu.ou.herbarium.service.CollectorDAO;
import edu.ou.herbarium.service.Folder;
import edu.ou.herbarium.service.FolderDAO;
import edu.ou.herbarium.service.ImageRaw;
import edu.ou.herbarium.service.ImageRawDAO;
import edu.ou.herbarium.service.SpecCollectorMap;
import edu.ou.herbarium.service.SpecCollectorMapDAO;
import edu.ou.herbarium.service.Specimen;
import edu.ou.herbarium.service.SpecimenDAO;
import edu.ou.herbarium.service.User;
import edu.ou.herbarium.service.UserAuthorityMap;
import edu.ou.herbarium.service.UserAuthorityMapDAO;
import edu.ou.herbarium.service.UserDAO;
import edu.ou.herbarium.utils.ImageUtils;
import edu.ou.herbarium.utils.ImageUtils2;

@javax.jws.WebService(targetNamespace = "http://main.herbarium.ou.edu/", serviceName = "DataUtilsService", portName = "DataUtilsPort", wsdlLocation = "WEB-INF/wsdl/DataUtilsService.wsdl")
public class DataUtilsDelegate {

	edu.ou.herbarium.main.DataUtils dataUtils = new edu.ou.herbarium.main.DataUtils();

	public Folder getTopFolders() {
		return dataUtils.getTopFolders();
	}

	public List<Specimen> getSpecimens() {
		return dataUtils.getSpecimens();
	}

	public Specimen getSpecimenById(int specId) {
		return dataUtils.getSpecimenById(specId);
	}

	public List<Specimen> getSpecimens2(int pageNo, int itemNoPerPage) {
		return dataUtils.getSpecimens2(pageNo, itemNoPerPage);
	}

	public ImageRaw getImageRaw(int imageRawId) {
		return dataUtils.getImageRaw(imageRawId);
	}

	public User validateLogin(String username, String password) {
		return dataUtils.validateLogin(username, password);
	}

	public List<Authority> getAuthorities(int userId) {
		return dataUtils.getAuthorities(userId);
	}

	public Specimen insertSpecimen(String imgFileUrl, String collectorName,
			Specimen spec, DataHandler full, DataHandler full_2,
			DataHandler full_3, DataHandler full_4) {
		return dataUtils.insertSpecimen(imgFileUrl, collectorName, spec, full,
				full_2, full_3, full_4);
	}

	public void updateSpecimen(Specimen spec) {
		dataUtils.updateSpecimen(spec);
	}

	public List<Collector> getCollectorsBySpecimen(Specimen spec) {
		return dataUtils.getCollectorsBySpecimen(spec);
	}

	public void setPort(String portNumber) {
		dataUtils.setPort(portNumber);
	}

}